﻿@page "/search"
@layout ImoviesBlazorAntPro.FrontLayout


<PageTitle>搜索结果页</PageTitle>

<div style="width: 95%;margin: 0 auto;">
    <!--头部-->
    <div class="video-header">
        <Card Bordered="true" Title="搜索结果：" Style="cursor: default;">
            <span>找到 @(_dataList.Count) 条记录！</span>
        </Card>
    </div>

    <!--主要内容-->
    <div class="list-container" style="margin-top: 20px;">
        @foreach (var video in _dataList)
        {
            <Card Bordered="false" Hoverable="true">
                <GridRow Style="">
                    <GridCol Style="width: 200px;text-align: center;">
                        <div style="width: 180px;height: 230px;margin: 0 auto;">
                            <img style="width: 100%;height: 100%;vertical-align: middle;object-fit: cover;" src="@video.Img">
                        </div>
                    </GridCol>
                    <GridCol Style="flex: 1;width: 80%;cursor: text;">
                        <div style="display: flex;flex-direction: column;">
                            <h3 style="margin: 0;font-weight: 600;">@video.Name</h3>
                            <div class="video-info-box">
                                <div>
                                    <span>类型：</span>@video.Category<br />
                                    <span>地区：</span>@video.Region<br />
                                    <span>年份：</span>@(video.Year)年<br />
                                    <span>导演：</span>@video.Director<br />
                                </div>
                                <div>
                                    <span>主演：</span>
                                    @video.Actors
                                </div>
                                <!-- 简介 -->
                                <div class="video-info-introduction">
                                    <span>简介：</span>
                                    @video.Intro
                                </div>
                            </div>
                        </div>
                    </GridCol>

                    <div style="width: 100%;margin: 15px 8px;">
                        <!--评语-->
                        <div style="margin-bottom: 10px;">
                            点评：<span style="color: #fa8c16; font-weight: 500;">好看啊好看啊好看啊</span>
                        </div>

                        <div>
                            <Tag PresetColor="@PresetColor.Purple" OnClick="@(()=>GetVlinksById(video.Id))" Style="cursor: pointer;">显示链接</Tag>

                            <a href="@video.Url" target="_blank"><Button Type="@ButtonType.Link">源站观看</Button></a>
                        </div>
                        @if (_vlinkCache.ContainsKey(video.Id))
                        {
                            <Space Size=@(("8", "10")) Wrap Style="margin-top: 5px;">
                                 @foreach (var vlink in _vlinkCache[video.Id])
                                {
                                    <SpaceItem>
                                        <Tag Color="#87d068" OnClick="@(() => GetRealPlayLink(vlink.Name,vlink.Url))"
                                             Style="cursor: pointer;">
                                            @vlink.Name
                                        </Tag>
                                    </SpaceItem>
                                }
                            </Space>
                        }
                    </div>
                    <Divider />
                </GridRow>
            </Card>
        }
    </div>
</div>


<!--播放器-->
<Modal Title="@_playerTitle" Footer="@null" Centered="@true" Draggable="@false"
       Keyboard="@false" MaskClosable="@false" DestroyOnClose="@true" Visible="@_playerIsVisible"
       OnCancel="PlayerClose" Width="1200" BodyStyle="padding: 0;height: 580px;" Style="height: 620px;">

    <iframe src="@_realPlayUrl" style="height: 100%;width: 100%;min-height: 466px;" frameborder="0" border="0" marginwidth="0"
            marginheight="0" scrolling="no" allowfullscreen="allowfullscreen" mozallowfullscreen="mozallowfullscreen"
            msallowfullscreen="msallowfullscreen" oallowfullscreen="oallowfullscreen"
            webkitallowfullscreen="webkitallowfullscreen" security="restricted"
            sandbox="allow-same-origin allow-forms allow-scripts"></iframe>
</Modal>


